|
|
So, is there a way to get a perfect average from a vector number? I'm
experimenting with eval_pigment and it has become necessary to convert vectors
to floats.
Chris Colefax wrote:
> SamuelT <STB### [at] aolcom> wrote:
> > Does anybody know how vlength converts vectors to floats? I've use it,
> > but I'm interested in knowing what the output is. Does it average the
> > vector numbers to create one float? Thanks in advance.
>
> I think you'll find it uses something more Pythagorean than a simple
> average: the formula for the length of a vector (as shown in the POV-Ray
> docs) is the square root of the sum of the squares of each of the vector's
> components, ie:
>
> sqrt (vdot(V, V))
>
> which equals:
>
> sqrt (V.x*V.x + V.y*V.y + V.z*V.z)
>
> in the case, obviously, of a three dimensional vector.
--
Samuel Benge
E-Mail: STB### [at] aolcom
Visit my isosurface tutorial at http://members.aol.com/stbenge
Post a reply to this message
|
|